package com.bsi.core.exception;

/**
 * 自定义状态码枚举类
 */
public enum SystemCode implements Code {
    ParamError(1000, "参数错误,请重新输入,错误信息为:%s"),
    UnauthorizedError(1001, "当前用户未登录,请登录后在进行此操作%s"),
    SystemUserLoginInvalid(1003, "用户登录token已失效，请重新登录%s"),
    SystemErrorCode(1005, "系统异常%s"),
    GoodRequest(2000, "请求成功");

    /**
     * 错误代码
     */
    private Integer code;

    /**
     * 错误信息
     */
    private String message;

    /**
     * 构造
     *
     * @param code    错误代码
     * @param message 错误信息
     */
    private SystemCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public Integer getCode() {
        // TODO Auto-generated method stub
        return code;
    }

    @Override
    public String getMessage() {
        // TODO Auto-generated method stub
        return message;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public void setMessage(String message) {
        this.message = message;
    }

}
